package cn.tree;

import java.util.ArrayList;

//封装队列类
public class Queue {
    private ArrayList<Node> nodeList=new ArrayList<>();
    //给队列添加node
    public void addNode(Node node){
        nodeList.add(node);
    }
    //从队列中取Node
    public Node pop(){
        if(nodeList.size()!=0){
          return   nodeList.remove(0);
        }else{
            return null;
        }
    }
    //队列长度
    public int queueLenght(){
        return nodeList.size();
    }
}
